// token 3个操作 - 存储/获取/删除

const hmttToken = "hmttToken";
// 1. 存储 token
export const setToken = (token) => {
	localStorage.setItem(hmttToken, token);
};
// 2. 获取 token - 注意这里没有写花括号，因为要 return 获取到的 token
export const getToken = () => localStorage.getItem(hmttToken);
// 3. 删除 token
export const removeToken = () => {
	localStorage.removeItem(hmttToken);
};
// 🔔小技巧：手打上面封装的函数名，VsCode 会有自动导入的提示。

const hmtt_followlist = "hmtt_followlist";
export const setCate = (Cate) => {
	localStorage.setItem(hmtt_followlist, JSON.stringify(Cate));
};
export const getCate = () => JSON.parse(localStorage.getItem(hmtt_followlist));
export const removeCate = () => {
	localStorage.removeItem(hmtt_followlist);
};

const hmtt_unfollowlist = "hmtt_unfollowlist";
export const setunCate = (unCate) => {
	localStorage.setItem(hmtt_unfollowlist, JSON.stringify(unCate));
};
export const getunCate = () => JSON.parse(localStorage.getItem(hmtt_unfollowlist));
export const removeunCate = () => {
	localStorage.removeItem(hmtt_unfollowlist);
};

const historylist = "historylist";
export const sethistory = (val) => {
	localStorage.setItem(historylist, JSON.stringify(val));
};
export const gethistory = () => JSON.parse(localStorage.getItem(historylist));
export const removehistory = () => {
	localStorage.removeItem(historylist);
};
